<?php
// +----------------------------------------------------------------------
// |优惠券
// +----------------------------------------------------------------------
// |Data:2016-06-29 下午2:21
// +----------------------------------------------------------------------
// |Author: 吕志雄 <870923001@qq.com>
// +----------------------------------------------------------------------
namespace Cli\Model;
class CronCouponModel{

    /**
     * 更改过期的优惠券(一分钟一次)
     */
    public function update(){
        $map = array();
        $map['end_time'] = array('lt',time());
        $map['is_overdue'] = 2;
        $list = M('coupons_receive_logs')->where($map)->field('id')->select();
        if($list){
            foreach($list as $val){
                M('coupons_receive_logs')->where('id='.$val['id'])->setField('is_overdue',1);
            }
        }
    }
}
?>